/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package si.projekt.DB;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Transient;

/**
 *
 * @author Igor
 */
@Entity
public class Uporabnik implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    
    private String ime;
    private String priimek;
    private String ulica;
    private int postnaSt;
    private String posta;
    private String email;
    private int telefonska;

     public Long getId() {
        return id;
    }

    public void setId(Long id) {
        Long oldId = this.id;
        this.id = id;
        changeSupport.firePropertyChange("id", oldId, id);
    }

    public String getIme() {
        return ime;
    }

    public void setIme(String ime) {
        String oldIme = this.ime;
        this.ime = ime;
        changeSupport.firePropertyChange("ime", oldIme, ime);
    }

    public String getPriimek() {
        return priimek;
    }

    public void setPriimek(String priimek) {
        String oldPriimek = this.priimek;
        this.priimek = priimek;
        changeSupport.firePropertyChange("priimek", oldPriimek, priimek);
    }

    public int getTelefonska() {
        return telefonska;
    }

    public void setTelefonska(int telefonska) {
        int oldTelefonska = this.telefonska;
        this.telefonska = telefonska;
        changeSupport.firePropertyChange("telefonska", oldTelefonska, telefonska);
    }

    public String getUlica() {
        return ulica;
    }

    public void setUlica(String ulica) {
        String oldUlica = this.ulica;
        this.ulica = ulica;
        changeSupport.firePropertyChange("ulica", oldUlica, ulica);
    }

    
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        String oldEmail = this.email;
        this.email = email;
        changeSupport.firePropertyChange("email", oldEmail, email);
    }

    public String getPosta() {
        return posta;
    }

    public void setPosta(String posta) {
        String oldPosta = this.posta;
        this.posta = posta;
        changeSupport.firePropertyChange("posta", oldPosta, posta);
    }

    public int getPostnaSt() {
        return postnaSt;
    }

    public void setPostnaSt(int postnaSt) {
        int oldPostnaSt = this.postnaSt;
        this.postnaSt = postnaSt;
        changeSupport.firePropertyChange("postnaSt", oldPostnaSt, postnaSt);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Uporabnik)) {
            return false;
        }
        Uporabnik other = (Uporabnik) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "si.projekt.DB.Uporabnik[ id=" + id + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }
    
}
